package Core 
{
	import flash.display.Bitmap;
	/**
	 * ...
	 * @author Serg de Adelantado
	 */
	public class ImageUtils 
	{		
		public function ImageUtils() 
		{			
		}
		
		public static function Resize(APhoto:Bitmap, AWidth:Number, AHeight:Number):void
		{
			var vWidth = APhoto.width;
			var vHeight = APhoto.height;
			
			if (vHeight > AHeight)
			{
				APhoto.width = vWidth * (AHeight / vHeight);            
				APhoto.height = AHeight;
			}
				
			vWidth = APhoto.width;
			vHeight = APhoto.height;
			
			if (vWidth > AWidth)
			{
				APhoto.height = vHeight * (AWidth / vWidth);            
				APhoto.width  = AWidth;
			}
		}
	}
}